#ifndef _MUART_H_
#define _MUART_H_
#include "driver/usb_serial_jtag.h"   // esp32c3 use usb
#include "freertos/FreeRTOS.h"

typedef struct 
{
	char port;
	char TxPin;
	char RxPin;
	unsigned int  baud;
}uart_dev;


uart_dev *uart_debug;
uart_dev *uart_use ;


void uart_read_task(void);
void uart_init(uart_dev dev);
void uartx_out(char *c,char len);
char uartx_read(char *buff,char len,TickType_t ticks_to_wait);


/* eps32c3 usb uart*/
void usb_uart_rxTask(void *pvParameter);
void usb_uart_init_intrupt(void);

#define UsbUartSend(buff,len)   usb_serial_jtag_write_bytes((const void *)buff, len, portMAX_DELAY)

#endif
